import core
from core import websocket

def startup():
    container = init_container()

    wb = websocket.Connector()
    wb.init_server(container)


def init_container():
    configure_validator = core.Validator()
    configure_validator.validate_and_import()

    if configure_validator.module:
        container = core.container.DefaultContainer(configure_validator.module)
    else:
        raise ValueError("configure parse error")

    return container

if __name__ == "__main__":
    startup();
